#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
void jishu(int* a, int n)
{
	int min = a[0];
	int max = a[0];
	for (int i = 1; i < n; i++)
	{
		if (a[i] < min)
		{
			min = a[i];
		}
		if (a[i] > max)
		{
			max = a[i];
		}
	}
	int range = max - min + 1;
	int* tmp = (int*)calloc(range, sizeof(int));
	if (tmp == NULL)
	{
		perror("calloc");
		return;
	}
	for (int i = 0; i < n; i++)
	{
		tmp[a[i]-min]++;
	}
	int as = 0;
	for (int j = 0; j < range; j++)
	{
		while (tmp[j]--)
		{
			a[as++] = j + min;
		}
	}
}
int main()
{
	int a[] = { -2345,-24356,-4578,-14,-67,-1,36,36,543,7654,7365,7,67988769,65,756867598,7698,890,87,9356,7299809,76,27,769,7267,8 };
	jishu(a, sizeof(a) / sizeof(a[0]));
	for (int i = 0; i < sizeof(a) / sizeof(a[0]); i++)
	{
		printf("%d ", a[i]);
	}

	return 0;
}